package com.kashow.base.adapter;

import android.view.ViewGroup;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.zhy.autolayout.utils.AutoUtils;

import java.util.ArrayList;
import java.util.List;

public abstract class MultiItemQuickAdapter<T extends MultiItemEntity>
        extends BaseMultiItemQuickAdapter<T,BaseViewHolder> {

    public MultiItemQuickAdapter(List<T> data) {
        super(data);
    }

    @Override
    public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        BaseViewHolder baseViewHolder = super.onCreateViewHolder(parent, viewType);
        AutoUtils.autoSize(baseViewHolder.itemView);
        return baseViewHolder;
    }

    public void setData(List<T> mData) {
        this.mData =  mData == null ? new ArrayList(): mData;
    }
}
